import Props from "../base/Props";
import defaultData from "./data";
import {Row} from "antd";
import {WeaLocaleProvider, WeaRichText} from "ecCom";

const { getLabel } = WeaLocaleProvider;

export default class FBHeaderProps extends Props {
  renderContent() {

    const ckConfig = {
      startupFocus: false,
      toolbar: [
        { name: 'styles', items: ['FontSize'] },
        { name: 'colors', items: ['TextColor', 'BGColor', 'RemoveFormat'] },
        { name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight'] },
        { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike'] },
        { name: 'links', items: ['Link', 'Unlink', '-', 'Maximize', 'Image'] },
      ],
      autoGrow_minHeight: 60,
      uploadUrl: '/api/edc/page/uploadFile4Editor',
      extraPlugins: 'image2,uploadimage,autogrow'
    };
    const { data } = this.props;
    const { footerDesc } = data;

    return (
        <Row>
          <label>{getLabel('506435','页脚描述')}</label>
          <WeaRichText ckConfig={ckConfig} value={footerDesc} onChange={this.handlePropChange('footerDesc')}/>
        </Row>
    )
  }
}

FBHeaderProps.defaultProps = {
  data: defaultData
};